package com.hzit.service.impl;

import com.hzit.MybatisUtil;
import com.hzit.entity.Student;
import com.hzit.mapper.StudentMapper;
import com.hzit.service.StudentService;
import com.hzit.vo.StudentVo;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

/**
 * 类名：
 * 作者：WF
 * 功能：
 */
public class StudentServiceImpl implements StudentService {
	private StudentMapper studentMapper ;
	//1. 查询所有学生
	@Override
	public List<StudentVo> findAll() {
		try (SqlSession session = MybatisUtil.getSession(true)) {
			studentMapper = session.getMapper(StudentMapper.class);
			List<StudentVo> students = studentMapper.findAll();
			return  students;
		}
	}
}
